﻿namespace WMS6.Services
{
    using System;
    using WMS6.BLL;
    using WMS6.DataEntity;

    public sealed class BaseInfoFactory
    {
        public static IBaseInfo CreateInstance(string className, PubParasInfo pubParasInfo)
        {
            if (!string.IsNullOrEmpty(className))
            {
                switch (className.ToUpper())
                {
                    case "UOM":
                        return new UomBLL(pubParasInfo);

                    case "CARTON":
                        return new CartonBLL(pubParasInfo);

                    case "ZONE":
                        return new ZoneBLL(pubParasInfo);

                    case "TRADE_PARTNER":
                        return new TradePartnerBLL(pubParasInfo);

                    case "ROLE":
                        return new RoleBLL();

                    case "AREA":
                        return new AreaBLL(pubParasInfo);

                    case "USER_MST":
                        if (pubParasInfo == null)
                        {
                            return new UserMstBLL();
                        }
                        return new UserMstBLL(pubParasInfo);

                    case "LOT_TEMPLATE":
                        return new LotTemplateBLL(pubParasInfo);

                    case "USER_PERMISSIONS":
                        return new UserPermissionsBLL(pubParasInfo);

                    case "PACK":
                        return new PackBLL(pubParasInfo);

                    case "LOCATION_TEMPLATE":
                        return new LocationTemplateBLL(pubParasInfo);

                    case "DOMAIN":
                        return new DomainBLL(pubParasInfo);

                    case "LOCATION":
                        return new LocationBLL(pubParasInfo);

                    case "PUTAWAY_RULE":
                        return new PutawayRuleBLL(pubParasInfo);

                    case "SYS_CODE":
                        return new SysCodeBLL(pubParasInfo);

                    case "ROTATION_RULE":
                        return new RotationRuleBLL(pubParasInfo);

                    case "PREALLOCATE_RULE":
                        return new PreallocateRuleBLL(pubParasInfo);

                    case "ALLOCATE_RULE":
                        return new AllocateRuleBLL(pubParasInfo);

                    case "TASK_RULE":
                        return new TaskRuleBLL(pubParasInfo);

                    case "FILTER_CONFIG_HEADER":
                        return new FilterConfigHeaderBLL(pubParasInfo);

                    case "SYS_SETTING":
                        return new SysSettingBLL(pubParasInfo);

                    case "DB_CONFIG":
                        return new DbConfigBLL();

                    case "CYCLE_COUNT_CLASS":
                        return new CycleCountClassBLL(pubParasInfo);

                    case "CUSTOMER":
                        return new CustomerBLL(pubParasInfo);

                    case "VENDOR":
                        return new VendorBLL(pubParasInfo);

                    case "CARRIER":
                        return new CarrierBLL(pubParasInfo);

                    case "BILLING_ENTITY":
                        return new BillingEntityBLL(pubParasInfo);

                    case "CYCLE_COUNT_RULE":
                        return new CycleCountRuleBLL(pubParasInfo);

                    case "AUDIT_DATA":
                        return new AuditDataBLL(pubParasInfo);

                    case "DRIVER":
                        return new DriverBLL(pubParasInfo);

                    case "EQUIPMENT_TYPE":
                        return new EquipmentTypeBLL(pubParasInfo);

                    case "TRANSPORT_EQUIPMENT":
                        return new TransportEquipmentBLL(pubParasInfo);

                    case "LOC_ADDR":
                        return new LocAddrBLL(pubParasInfo);

                    case "LOC_SITE":
                        return new LocSiteBLL(pubParasInfo);

                    case "CONTRACT":
                        return new ContractBLL(pubParasInfo);

                    case "SUBJECT":
                        return new SubjectBLL(pubParasInfo);

                    case "RATE":
                        return new RateBLL(pubParasInfo);

                    case "GENERAL_LEDGER":
                        return new GeneralLedgerBLL(pubParasInfo);

                    case "TARIFF":
                        return new TariffBLL(pubParasInfo);

                    case "BILLING_SERVICE":
                        return new BillingServiceBLL(pubParasInfo);

                    case "ACCESSORIAL":
                        return new AccessorialBLL(pubParasInfo);

                    case "CALENDAR_GROUP":
                        return new CalendarGroupBLL(pubParasInfo);

                    case "EQUIPMENT_POR_FILE":
                        return new EquipmentProfileBLL(pubParasInfo);

                    case "RECEIPT_VALIDATION":
                        return new ReceiptValidationBLL(pubParasInfo);

                    case "UDF_REPORT_SETTING":
                        return new UdfReportSettingBLL(pubParasInfo);

                    case "EMAIL_SETTING":
                        return new EmailSettingBLL(pubParasInfo);
                }
            }
            return null;
        }
    }
}

